1. Field of the Invention
The present invention relates to a method and apparatus for visual measurement, which detects a focusing position for an object to be measured from contrast values of image information obtained by an image pick-up system and measures a displacement of the object along the optical axis based on the focusing position.
2. Description of the Related Art
One of non-contact vision measuring machine known in the art focuses an optical image of a work, or an object to be measured, onto a photoreceptive surface of an image pick-up device to measure a displacement of the object along the optical axis. This visual measurement system computes an image contrast value based on a variance of brightness of an image data obtained from the image pick-up device such as a CCD (Charge Coupled Device) that picks up an image of the work. A position of the image pick-up system relative to the work is determined so as to maximize the image contrast value. A displacement of the image pickup system along the optical axis can be computes based on the position. In such the conventional visual measurement system, a position particularly desired to measure can be specified through an operation for setting a window.
In the conventional visual measurement system mentioned above, however, it is required, when plural portions on the work are subjected to measurement, to set the same number of windows and repeat the measurement. This causes a disadvantage to increase a time period for measurement.
The present invention has been made in consideration of the above and accordingly has an object to provide a method and apparatus for visual measurement capable of measuring a plurality of portions on a work at a high speed.
The present invention is provided with an apparatus for visual measurement, which comprises an image pick-up system for picking up an image of an object to be measured to obtain image information. The image pick-up system includes an optical system and image pick-up means. Driving means shifts a focal position, located at the object side, of the image pick-up system along the optical axis relatively to the object. Measurement means measures a relative displacement of the focal position of the image pick-up system along the optical axis. Arithmetic means computes an image contrast value at each of a plurality of different regions of the image information obtained at each relative focal position by the image pick-up system during the driving means relatively shifts the focal position of the image pick-up system along the optical axis. It determines a measure for the each region based on the relative displacement along the optical axis obtained from the measurement means when the image contrast value comes to the maximum in the each region.
The present invention is also provided with a method for visual measurement. In the step of shifting, an image pick-up system is relatively shifted for an object to be measured to the initial position, and then a relative focal position of the image pick-up system is relatively shifted along the optical axis together with picking up an image of the object by the image pick-up system. In the step of reading, with a constant time interval during the whole time period of shifting the relative focal position of the image pick-up system, the relative focal position (Z value) is read. Each contrast value in each of a plurality of different regions of image information obtained by the image pick-up system is also read. In the step of stopping, the image pick-up system is stopped when the relative focal position of the image pick-up system comes to the final position. In the step of presuming, for the each region, a contrast Curve is presumed, which indicates a relation of the contrast value to the relative focal position of the image pick-up system. In the step of computing, the relative focal position (Z value) of the each region in computed from the contrast curve of the each region.
According to the present invention, a contrast value is computed for each of a plurality of different regions of the image information obtained at each relative focal position, with shifting the relative focal position of the image pick-up system. A measure for each region is determined based on the relative displacement along the optical axis when the contrast value comes to the maximum in each region. Therefore, the relative displacement can be computed for each region only with one relative scanning of the image pick-up system along the optical axis. This leads to an extremely high-speed measurement.
Each region used for computing the contrast value may partly overlap with each other. This overlap allows computation of relative displacements of much more points based on a sufficient amount of data. The arithmetic means may presume, for each region, from the contrast values obtained at each relative focal position by the image pickup system, a curve of contrast values relative to the relative displacement of the image pick-up system along the optical axis. It determines the relative displacement at each region along the optical axis based on the curve of contrast values. In this case, a high resolution can be achieve by the presumed curve, with reducing an arithmetic time by a rough sampling.
Other features and advantages of the invention will be apparent from the following description of the preferred embodiments thereof.